use container_core::scheduler::simple_scheduler;
use std::borrow::BorrowMut;

use model_graph_types::container::sheduler::Scheduler;

pub async fn start() -> anyhow::Result<()> {
    let scheduler = simple_scheduler();

    scheduler
        .lock()
        .map_err(|err| anyhow::anyhow!("{}", err))?
        .borrow_mut()
        .reload_tasks()
        .await?;
    Ok(())
}
